import os
import sys

if __name__ == '__main__':
	
    if len(sys.argv) < 2:
	print 'must input a file.'

    filename = sys.argv[1]
    if not os.path.exists(filename):
        sys.exit(0)

    outname = filename + '.c'
    fd = open(filename, 'r')
    fdout = open(outname, 'w')
    i = 0
    for line in fd.xreadlines():
        if line.find('@') == -1:
            continue
        fmt = line.split('@')
	t1 = fmt[0]
	t2 = t1.split('dd offset _')
        dststr = '_T(\"%s\"),\n' %  t2[1]
        fdout.write(dststr)
        i += 1
    fd.close()
    fdout.close()
        
